<template>
    <div>
        <p>{{title}}</p>
        <button @click="incrementCounter">{{num}}</button>
    </div>
</template>

<script>
    export default{
        name: 'a1',
        data () {
            return {
                num: 0
            }
        },
        methods: {
            incrementCounter(){
                this.num +=1;
                this.$emit("increment");
                this.$emit('update:title', 'new')
            }
        },
        props:['title']
    }
</script>